package com.sikaryofficial.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sikaryofficial.backend.domain.dto.req.information.ArticleAssociateListReq;
import com.sikaryofficial.backend.domain.dto.req.information.ArticleAuditListReq;
import com.sikaryofficial.backend.domain.dto.req.information.ArticleBrandSpecialListReq;
import com.sikaryofficial.backend.domain.dto.req.information.ArticleOwnerListReq;
import com.sikaryofficial.backend.domain.dto.req.information.TopicListReq;
import com.sikaryofficial.backend.domain.dto.resp.information.ArticleGetLikesDTO;
import com.sikaryofficial.backend.domain.dto.resp.information.TopicBackendDTO;
import com.sikaryofficial.backend.domain.dto.resp.information.TopicDTO;
import com.sikaryofficial.backend.domain.entity.Article;
import com.sikaryofficial.backend.domain.vo.infomation.ArticleStatisticsVO;
import com.sikaryofficial.system.api.model.infomation.ArticleAssociateResp;
import com.sikaryofficial.system.api.model.infomation.ArticleDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 文章Mapper接口
 *
 * @author qinjinyuan
 * @date 2024-04-10
 */
public interface ArticleMapper extends BaseMapper<Article> {
    /**
     * topic分页列表
     *
     * @param customerPage
     * @param req
     * @return
     */
    IPage<TopicDTO> topicList(Page<TopicDTO> customerPage, @Param("req") TopicListReq req);

    IPage<TopicBackendDTO> topicBackendList(Page<TopicBackendDTO> customerPage, @Param("req") TopicListReq req);

    IPage<ArticleDTO> ownerList(Page<ArticleDTO> customerPage, @Param("req") ArticleOwnerListReq req);

    IPage<ArticleDTO> articleList(Page<ArticleDTO> customerPage, @Param("req") ArticleAuditListReq req);

    IPage<ArticleGetLikesDTO> getLikeList(Page<ArticleGetLikesDTO> customerPage,
                                          @Param("userId") Long userId, @Param("businessType") Integer businessType);

    IPage<ArticleAssociateResp> associatePage(Page<ArticleAssociateResp> customerPage, @Param("req") ArticleAssociateListReq req);

    List<ArticleStatisticsVO> articleContentTypeStatic(@Param("source") Integer source, @Param("auditStatus") Integer auditStatus
                                ,@Param("userId")Long userId);

    IPage<ArticleDTO> brandSpecialPage(Page<ArticleDTO> customerPage, @Param("req") ArticleBrandSpecialListReq req);

    List<ArticleDTO> getArticleByIds(@Param("objIds") List<Long> objIds, @Param("tenantId") Integer tenantId);
}
